/*******************************************************************************
 * Copyright (c) 2009 Dop Sun.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     Dop Sun - initial API and implementation
 ******************************************************************************/
package com.softao.ming.gde.internal.core.bootstrap;

import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;

import com.softao.ming.gde.internal.core.pde.PdeCoreUtil;

/**
 * 
 */
public class BootstrapApplication {
	private String mUniqueIdentifier;
	private String mClassName;
	
	/**
	 * @param applicationId 
	 */
	public BootstrapApplication(String applicationId) {
		this.mUniqueIdentifier = applicationId;
		
		IExtension[] extensions = PdeCoreUtil.findExtensions("com.softao.ming.gwt.core.runtime.applications", true);
		for (IExtension extension : extensions) {
			IConfigurationElement[] elements = extension.getConfigurationElements();
			for (IConfigurationElement element : elements) {
				if (element.getAttribute("id").equals(mUniqueIdentifier)) {
					mClassName = element.getAttribute("class");
				}
			}
		}
	}
	
	/**
	 * @return the uniqueIdentifier
	 */
	public String getUniqueIdentifier() {
		return mUniqueIdentifier;
	}

	/**
	 * @return the className
	 */
	public String getClassName() {
		return mClassName;
	}
	
}
